<template>
	<view class="warp warp_box">
		<image style="width: 100%;height: 100%;z-index: 1;" src="http://xiaowen.cool:86/yjky/bg.png" mode="aspectFill">
		</image>
		<view class="big_box flex">
			<image :src="list.assistant" style="width: 270rpx;height: 270rpx;" mode="aspectFill"
				@longpress='saveToBlum(list.assistant)'></image>
			<image :src="list.questionnaire" style="width: 270rpx;height: 270rpx;" mode="aspectFill"
				@longpress='saveToBlum(list.questionnaire)'></image>
			<view class="title">{{list.title}}</view>

		</view>
	</view>
</template>

<script>
	import {
		advisory
	} from '../../../api/api.js'
	export default {
		data() {
			return {
				list: {},
			}
		},
		onLoad() {
				// 请求首页数据
				let sign = this.$util()
			advisory(sign).then(res => {
				this.list = res.data
			})
		},
		methods:{
			//保存网络图片到相册方法
			saveToBlum(e) {
					console.log(e)
					wx.downloadFile({
						url: e,
						success: function(res) {
							wx.saveImageToPhotosAlbum({
								filePath: res.tempFilePath,
								success(result) {
									wx.showToast({
										title: '保存成功',
										icon: 'success'
									})
								}
							})
						}
					})
				},
		}
	}
</script>

<style scoped lang="less">
	.warp_box {
		position: fixed;

		.big_box {
			z-index: 9;
			width: 600rpx;
			position: absolute;
			top: 50%;
			left: 50%;
			transform: translateX(-50%);
			height: 400rpx;
			background-color: #FFFFFF;
			border-radius: 30rpx;

			.title {
				color: #999999;
				font-size: 21rpx;
				position: absolute;
				bottom: 30rpx;
			}
		}
	}
</style>
